#include "SineLayer.h"
#include <math.h>
#include "../Initializers/NguyenWidrowFunction.h"

using namespace NeuralPlusPlus::Core;
using namespace NeuralPlusPlus::Core::Backpropagation;
using namespace NeuralPlusPlus::Core::Initializers;

NeuralPlusPlus::Core::Backpropagation::SineLayer::SineLayer( int neuronCount ) : ActivationLayer(neuronCount)
	{
	this->Initializer = new NguyenWidrowFunction();
	}

double NeuralPlusPlus::Core::Backpropagation::SineLayer::Activate( double input, double previousOutput )
	{
	return sin(input);
	}

double NeuralPlusPlus::Core::Backpropagation::SineLayer::Derivative( double input, double output )
	{
	return sqrt(1 - output * output);
	}